﻿using Common.Device.Enums;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Common.Device.DeviceDb
{
    [SugarTable("UseDevice")]
    public class UseDevice
    {
        /// <summary>
        /// 设备标识
        /// </summary>
        [SugarColumn(IsPrimaryKey = true)] 
        public string name { get; set; }
        /// <summary>
        /// 仪器
        /// </summary>
        [SugarColumn(ColumnDataType = "nvarchar(50)")] // 将枚举映射到nvarchar类型
        public DeviceEnum.DeviceTempEnum temp { get; set; }
        /// <summary>
        /// 仪器类型
        /// </summary>
        [SugarColumn(ColumnDataType = "nvarchar(50)")] // 将枚举映射到nvarchar类型
        public DeviceEnum.DeviceTypeEnum type { get; set; }
        /// <summary>
        /// 设备型号
        /// </summary>
        [SugarColumn(ColumnDataType = "nvarchar(50)")] // 将枚举映射到nvarchar类型
        public DeviceEnum.DeviceModelEnum model { get; set; }
        /// <summary>
        /// 通信方式
        /// </summary>
        public DeviceEnum.DeviceModeEnum mode { get; set; }
        /// <summary>
        /// 通信端口 COM1/127.0.0.1:9999/USB
        /// </summary>
        public string port { get; set; }
        /// <summary>
        /// 通信地址
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string addr { get; set; }
        /// <summary>
        /// 通信参数
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string parameter { get; set; }
        /// <summary>
        /// 通信参数
        /// </summary>
        [SugarColumn(IsNullable = true)]
        public string parameter2 { get; set; }
        /// <summary>
        /// 仪器描述
        /// </summary>
        [SugarColumn(ColumnDataType = "nvarchar(1000)", IsNullable = true)]
        public string descripe { get; set; }
    }
}
